//
//  FSToDoingViewController.m
//  WZSOA
//
//  Created by 刘沿 on 16/6/20.
//  Copyright © 2016年 刘沿. All rights reserved.
//

#import "FSToDoingViewController.h"

@interface FSToDoingViewController ()

@property (weak, nonatomic) IBOutlet UIView *View1;

@property (weak, nonatomic) IBOutlet UIView *View2;


@end

@implementation FSToDoingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"在办工作";
//标签栏
    UIView *view1 = [[UIView alloc] init];
    view1.backgroundColor = [UIColor whiteColor];
    [self.View1 addSubview:view1];
    
    [view1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        //        make.top.equalTo(self.view.mas_top).with.offset(@44);
        
        make.top.equalTo(self.View1.mas_top).mas_offset(5);
        
        make.left.equalTo(self.View1.mas_left).mas_offset(10);
        
        make.right.equalTo(self.View1.mas_right).mas_offset(-10);
        
        make.height.equalTo(@40);
        
    }];
// 在办收文
    UIImageView *image1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"在办收文"]];
    
    [view1 addSubview:image1];
    
    [image1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(view1.mas_top).mas_offset(5);
        
        make.left.equalTo(view1.mas_left).mas_offset(5);
        
        make.bottom.equalTo(view1.mas_bottom).mas_offset(-5);
        
        make.width.equalTo(@30);
    }];
    
    UILabel *lbl1 = [[UILabel alloc] init];
    
    lbl1.text = @"在办收文";
    
    [view1 addSubview:lbl1];
    
    [lbl1 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(view1.mas_top).mas_offset(5);
        
        make.left.equalTo(image1.mas_right).mas_offset(5);
        
        make.bottom.equalTo(view1.mas_bottom).mas_offset(-5);
        
        make.width.equalTo(@200);
    }];
    
    
//列表栏
    UIView *view2 = [[UIView alloc] init];
    [self.View1 addSubview:view2];
    
    [view2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(view1.mas_bottom).mas_offset(5);
        
        make.left.equalTo(self.view.mas_left).mas_offset(10);
        
        make.right.equalTo(self.view.mas_right).mas_offset(-10);
        
//        make.height.equalTo(@(H));
        
        make.bottom.equalTo(self.View1.mas_bottom).mas_offset(-10);
        
    }];
    
    
//标签栏
    UIView *view3 = [[UIView alloc] init];
    view3.backgroundColor = [UIColor whiteColor];
    [self.View2  addSubview:view3];
    
    [view3 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.View2.mas_top).mas_offset(10);
        
        make.left.equalTo(self.view.mas_left).mas_offset(10);
        
        make.right.equalTo(self.view.mas_right).mas_offset(-10);
        
        make.height.equalTo(@40);
        
        
    }];
    
    UIImageView *imageView2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"在办发文"]];
    
    [view3 addSubview:imageView2];
    
    [imageView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(view3.mas_top).mas_offset(5);
        
        make.left.equalTo(view3.mas_left).mas_offset(5);
        
        make.bottom.equalTo(view3.mas_bottom).mas_offset(-5);
    
        make.width.equalTo(@30);
    }];
    
    UILabel *label2 = [[UILabel alloc] init];
    
    label2.text = @"在办发文";
    
    [view3 addSubview:label2];
    
    [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(view3.mas_top).mas_offset(5);
        
        make.left.equalTo(imageView2.mas_right).mas_offset(5);
        
        make.bottom.equalTo(view3.mas_bottom).mas_offset(-5);
    
        make.width.equalTo(@200);
    }];
    
//列表栏
    UIView *view4 = [[UIView alloc] init];
    [self.View2 addSubview:view4];
    
    [view4 mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(view3.mas_bottom).mas_offset(5);
        
        make.left.equalTo(self.view.mas_left).mas_offset(10);
        
        make.right.equalTo(self.view.mas_right).mas_offset(-10);
        
        make.bottom.equalTo(self.View2.mas_bottom).mas_offset(-10);
    }];
    
    

    FSToDoingReceiveController *toDorece = [[FSToDoingReceiveController alloc] init];
    
    toDorece.view.frame = view2.bounds;
    
    [view2 addSubview:toDorece.view];
    
    
    FSToDoingSendController *todoSend = [[FSToDoingSendController alloc] init];
    todoSend.view.frame = view4.bounds;
    
    [view4 addSubview:todoSend.view];
    
    
//详情界面
    
    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

    FSUpDoingDetailController *upDetail = [sb instantiateViewControllerWithIdentifier:@"UpDoingDetailVC"];

    
    [toDorece setReceiveBlock:^(NSString *field) {
        
        upDetail.isAlreadDoneWork = YES;
        
        upDetail.fileId = field;
        
        [self.navigationController pushViewController:upDetail animated:YES];
        
    }];
    

    FSUpDoingDetailController *upDetail2 = [sb instantiateViewControllerWithIdentifier:@"UpDoingDetailVC"];
    [todoSend setSendBlock:^(NSString *field) {
        
        upDetail2.isAlreadDoneWork = YES;
        
        upDetail2.fileId = field;
        
        [self.navigationController pushViewController:upDetail2 animated:YES];
    }];
    
    
    
}



@end






















